package com.sodaopen.study.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
public class Chapter {

	private Integer id;
	private String name;
	private String content;
	private String title;
	private String icon;
	private Integer sort;
	private Integer pid;
	private Integer courseId;
	private Integer mediaId;
	private Date createdDate;
	private Date lastUpdateDate;
	
	private List<Chapter> children; 
	private String finished = "N"; //是否已学习完，值只有"Y"和"N"
	private String locked = "N"; //是否要锁定章节直到学习完成？值只有"Y"和"N"
	
	public void addChild(Chapter child) {
		if(children == null) {
			children = new ArrayList<>();
		}
		children.add(child);
	}
	
	
}
